Skip to content

Builder support: MON-10, MON-11, MON-17#1

Open
adnanomerovic wants to merge 2 commits intomasterfrom
ao/to-builder-docs-fix
Open

Builder support: MON-10, MON-11, MON-17#1
adnanomerovic wants to merge 2 commits intomasterfrom
ao/to-builder-docs-fix

Conversation

@adnanomerovic
Copy link
Copy Markdown
Contributor

No description provided.

@adnanomerovic adnanomerovic self-assigned this Mar 6, 2020
* @param cvc the CVC code
*/
public Card(
private Card(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Revert to public modifier with @deprecated
  • Deprecation message should be something like: use Card.create
  • Also note that public constructor will be removed in future, in future versions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EnilPajic I'm interested in your opinion as well

private Integer expMonth;
private Integer expYear;
private boolean tokenizePan;
private Map<String, Object> metaData;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this field to 'data', meta is more data about entity itself. Data pushed to this field are more additional/non card data, not info about card itself.

final Integer expMonth,
final Integer expYear,
final String cvc,
Map<String, Object> metaData) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename every occurrence of 'metaData' to 'data'

return this;
}

public Object getCountry() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not design api in a way:

  • field(TYPE)
  • Object getField()

If field type is clearly set in setter same type should be as return type.

getCountry should return String not Object. Same stands for any other field. Also add @Nullable annotation (from android-x package)


import java.util.Map;

public enum AdditionalData {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • additional data should be package local, not public
  • field names should be constants within same file, package local visible
  • Use field_name const in builder as well

}
final String value = (String) fieldValue;
return value.matches(validationData) && value.length() >= minLength && value.length() <= maxLength;
case META_DATA_VALIDATION:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename META_DATA_VALIDATION to MAP_SIZE_VALIDATION

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants